package org.nowcoder.huawei.other;

import java.io.BufferedReader;
import java.io.InputStreamReader;


/**
 * HJ23: 删除字符串中出现次数最少的字符
 */
public class HJ23 {

    public static void hj23() throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int[] vals = new int[26];

        //统计字母出现的次数
        for (int i = 0; i < line.length(); i++) {
            int c = line.charAt(i) - 97;
            vals[c] += 1;
        }

        //出现次数最小的数字
        int min = vals[0];
        for (int i = 1; i < 26; i++) {
            if (min == 0) {
                min = vals[i];
            } else {
                int tmp = vals[i];
                if (tmp != 0 && tmp < min) {
                    min = tmp;
                }
            }
        }

        StringBuilder build = new StringBuilder();
        for (int i = 0; i < line.length(); i++) {
            if (vals[line.charAt(i) - 97] > min) {
                build.append(line.charAt(i));
            }
        }
        System.out.print(build.toString());
    }
}
